﻿
@{
    ViewBag.Title = "Index";
}

<h2>用户登录测试</h2>

<a class="btn btn-primary" href="@Url_Helper.GetDomian_Server()/view/test1.html">
    服务器端页面
</a>
<a class="btn btn-danger" href="@Url_Helper.GetDomian_Session2()/usertwo">
    Session2页面
</a>
<br /><br />
<script src="@Url_Helper.GetDomian_Server()/View/jquery.cookie.js"></script>
<script src="@Url_Helper.GetDomian_Server()/View/AcountOperate.js"></script>

<input type="button" value="登录处理" id="btn1" />
<input type="button" value="获取登录用户信息" id="btn2" />
<h1></h1>
<script>
    //account.getSessionID();
    account.login_init();
    $('#btn1').click(function () {
        account.checkuser('张三', '123', function (data) {
            if (data != '0') {
                $.cookie('user', data, { path: '/' });
                alert('登录成功');
                location.reload();
            }
        });
    });
    $('#btn2').click(function () {
        var result = account.getuser();
        $('h1').text(result);
    }).trigger('click');
</script>